$OpenBSD: patch-install_sh,v 1.4 2015/10/21 10:45:08 sthen Exp $
--- install.sh.orig	Tue Oct 20 17:17:32 2015
+++ install.sh	Tue Oct 20 17:19:39 2015
@@ -16,14 +16,14 @@ installShared()
 }
 
 # global install
-DEST_HOME=/usr/local
+DEST_HOME=${PREFIX}
 # for testing 
 # DEST_HOME=${HOME}/INSTALL/usr/local
 DEST_BIN=${DEST_HOME}/bin
 DEST_SHARE=${DEST_HOME}/lib/p7zip
 DEST_MAN=${DEST_HOME}/man
 DEST_SHARE_DOC=${DEST_HOME}/share/doc/p7zip
-DEST_DIR=
+DEST_DIR=${DESTDIR}
 [ "$1" ] && DEST_BIN="$1"
 [ "$2" ] && DEST_SHARE="$2"
 [ "$3" ] && DEST_MAN="$3"
@@ -177,11 +177,14 @@ fi
 
 if [ -d DOC ]
 then
-  echo "- installing HTML help in ${DEST_DIR}${DEST_SHARE_DOC}/DOC"
+  echo "- installing HTML help in ${DEST_DIR}${DEST_SHARE_DOC}"
   mkdir -p "${DEST_DIR}${DEST_SHARE_DOC}"
   cp -r DOC "${DEST_DIR}${DEST_SHARE_DOC}/DOC"
   find "${DEST_DIR}${DEST_SHARE_DOC}/DOC" -type d -exec chmod 755 {} \;
   find "${DEST_DIR}${DEST_SHARE_DOC}/DOC" -type f -exec chmod 644 {} \;
+  cp -r DOC "${DEST_DIR}${DEST_SHARE_DOC}"
+  find "${DEST_DIR}${DEST_SHARE_DOC}" -type d -exec chmod 555 {} \;
+  find "${DEST_DIR}${DEST_SHARE_DOC}" -type f -exec chmod 444 {} \;
 fi
 
 use_lang="n"
